package b.i.j;

import android.util.Log;
import com.huawei.hms.analytics.core.crypto.AesCipher.AesLen;
import java.io.Writer;

@Deprecated
/* compiled from: LogWriter */
public class a extends Writer {
    public final String a;
    public StringBuilder b = new StringBuilder(AesLen.ROOTKEY_COMPONET_LEN);

    public a(String str) {
        this.a = str;
    }

    public void close() {
        n();
    }

    public void flush() {
        n();
    }

    public final void n() {
        if (this.b.length() > 0) {
            Log.d(this.a, this.b.toString());
            StringBuilder stringBuilder = this.b;
            stringBuilder.delete(0, stringBuilder.length());
        }
    }

    public void write(char[] cArr, int i, int i2) {
        for (int i3 = 0; i3 < i2; i3++) {
            char c = cArr[i + i3];
            if (c == 10) {
                n();
            } else {
                this.b.append(c);
            }
        }
    }
}
